﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="AssignEmployeeEvaluation_new.aspx.cs" Inherits="BSCMFF.Web.Pages.Evaluation_Setup.Personalist.AssignEmployeeEvaluation_new" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        meta:resourcekey="RadAjaxLoadingPanel1Resource1">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
        LoadingPanelID="RadAjaxLoadingPanel1" HorizontalAlign="NotSet" 
        meta:resourcekey="RadAjaxPanel1Resource1">
  
    <bsc:EvaluationSelection ID="EvalSelection" runat="server" />
    <br />
       
    <bsc:EmployeeGroupSelection ID="EGS" runat="server" 
            ActionButtonName="Preview Selection" Visible="False" 
    OnActionButtonClicked="RadButtonPreviewUsers_Click"  />


    <br />
 <asp:Panel ID="PanelAssignNewEmployees" runat="server" 
            meta:resourcekey="PanelAssignNewEmployeesResource1"> 
        <asp:Label ID="LabelToAssignEmployees" runat="server" 
            Text="Employees to be assigned" 
            meta:resourcekey="LabelToAssignEmployeesResource1" ></asp:Label>
        <br />
            <asp:PlaceHolder ID="PlaceHolderAssignNew" runat="server" >
                <table class="TableHeaerAssignEvaluation">
                    <tr>
                        <td style="width:200px">
                            <asp:Label ID="LabelFullname" runat="server" Text="Employee" 
                                meta:resourcekey="LabelFullnameResource1" ></asp:Label>
                        </td>
                        <td style="width:200px;padding-left:30px;padding-right:30px">
                            <asp:Label ID="LabelDepartment" runat="server" Text="Department" 
                                meta:resourcekey="LabelDepartmentResource1" ></asp:Label>
                        </td>
                        <td style="width:300px">
                            <asp:Label ID="Label1" runat="server" Text="Evaluator" 
                                meta:resourcekey="Label1Resource1" ></asp:Label>
                        </td>
                        
                    </tr>
                </table>
            </asp:PlaceHolder>
        <br />
        
</asp:Panel>
<telerik:RadButton ID="RadButtonConfirm" runat="server"
            Text="Assign Employees to Evaluation" onclick="RadButtonConfirm_Click" 
        meta:resourcekey="RadButtonConfirmResource1">
</telerik:RadButton>
<br />
<asp:Panel ID="PanelAlreadyAssignedEmployees" runat="server" 
            meta:resourcekey="PanelAlreadyAssignedEmployeesResource1">
    <asp:Label ID="Label5" runat="server" Text="Already Assigned Employees" 
        meta:resourcekey="Label5Resource1" ></asp:Label>
    <br />
    <telerik:RadGrid ID="RadGridAlreadyAssignedEmployees" runat="server" 
        AutoGenerateColumns="False" AllowAutomaticDeletes="True"
        onupdatecommand="RadGridAlreadyAssignedEmployees_UpdateCommand" 
        DataSourceID="EntityDataSourceEEEs" CellSpacing="0" GridLines="None" 
        meta:resourcekey="RadGridAlreadyAssignedEmployeesResource1" >
        <MasterTableView DataKeyNames="ID" EditMode="InPlace" 
            DataSourceID="EntityDataSourceEEEs">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>                   
                <telerik:GridBoundColumn DataField="User.Firstname" ReadOnly="True"
                    FilterControlAltText="Filter Firstname column" HeaderText="Firstname" 
                    SortExpression="Firstname" UniqueName="Firstname" 
                    meta:resourcekey="GridBoundColumnResource1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="User.Lastname"  ReadOnly="True"
                    FilterControlAltText="Filter Lastname column" HeaderText="Lastname" 
                    SortExpression="Lastname" UniqueName="Lastname" 
                    meta:resourcekey="GridBoundColumnResource2">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="User.Email"  ReadOnly="True"
                    FilterControlAltText="Filter Email column" HeaderText="Email" 
                    SortExpression="Email" UniqueName="Email" 
                    meta:resourcekey="GridBoundColumnResource3">
                </telerik:GridBoundColumn>
                    
                    
                <telerik:GridBoundColumn DataField="User.EmployeeID"  ReadOnly="True"
                    FilterControlAltText="Filter EmployeeID column" HeaderText="EmployeeID" 
                    SortExpression="EmployeeID" UniqueName="EmployeeID" 
                    meta:resourcekey="GridBoundColumnResource4">
                </telerik:GridBoundColumn>
                    
                <telerik:GridBoundColumn DataField="User.SBU.Name" HeaderText="SBU"   ReadOnly="True"
                    SortExpression="SBU.Name" UniqueName="SBU.Name" 
                    FilterControlAltText="Filter SBU.Name column" 
                    meta:resourcekey="GridBoundColumnResource5">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="User.Job_Position" 
                    FilterControlAltText="Filter Job_Position column" 
                    HeaderText="Job_Position"  ReadOnly="True"
                    SortExpression="Job_Position" UniqueName="Job_Position" 
                    meta:resourcekey="GridBoundColumnResource6">
                </telerik:GridBoundColumn>
                
                <telerik:GridTemplateColumn UniqueName="Evaluator" 
                    FilterControlAltText="Filter Evaluator column" 
                    meta:resourcekey="GridTemplateColumnResource1">
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="RadComboBoxEmployee" runat="server" Height="200px" Width="200px" 
                            DropDownWidth="298px" EmptyMessage="Choose an Employee" 
                            AllowCustomText="True" Filter="Contains"
                                    HighlightTemplatedItems="True" 
                                    DataTextField="Fullname" DataValueField="ID" 
                               DataSourceID="EntityDataSourceUsers" OnSelectedIndexChanged="Pokus"
                                      SelectedValue='<%# Bind("Evaluator_FK") %>' meta:resourcekey="RadComboBoxEmployeeResource1"
                            >
                            <HeaderTemplate>
                                <table style="width: 275px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 55px;">
                                            <asp:Label ID="LabelPhoto" runat="server" Text="Photo" 
                                                meta:resourcekey="LabelPhotoResource1" ></asp:Label>
                                        </td>
                                        <td style="width: 180px;">
                                            <asp:Label ID="LabelEmployeeName" runat="server" Text="Fullname" 
                                                meta:resourcekey="LabelEmployeeNameResource1" ></asp:Label>
                                        </td>
                                        <td style="width: 60px;">
                                            <asp:Label ID="LabelJobPosition" runat="server" Text="Job Position" 
                                                meta:resourcekey="LabelJobPositionResource1" ></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width: 300px" cellspacing="0" cellpadding="2">
                                    <tr>
                                        <td style="width: 55px;">
                                            <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" 
                                                DataValue='<%# Eval("Photo") %>' ImageUrl="~/Images/silhouette/silhouette-stewie.jpg"
                                            Width="50px" Height="50px" AutoAdjustImageControlSize="False" 
                                                meta:resourcekey="RadBinaryImage1Resource1" />
                                        </td>
                                        <td style="width: 180px;">
                                            <%--<%# DataBinder.Eval(Container, "User.Login")%>--%>
                                        </td>
            
                                        <td style="width: 60px;">
                                            <%# Eval("Job_Position")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            </telerik:RadComboBox> 
                    </EditItemTemplate>
                    <HeaderTemplate>
                        <h4>
                            <asp:Label ID="HeaderEvaluator" runat="server" 
                                meta:resourcekey="HeaderEvaluatorResource1" Text="Evaluator"></asp:Label>
                        </h4>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LabelManager" runat="server" 
                            meta:resourcekey="LabelManagerResource1" Text='<%# Eval("User1.Fullname") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column" 
                    meta:resourcekey="GridEditCommandColumnResource1" ></telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn Text="Delete" CommandName="Delete" 
                    FilterControlAltText="Filter column column" 
                    meta:resourcekey="GridButtonColumnResource1" UniqueName="column" ></telerik:GridButtonColumn>
            </Columns>
            
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" 
                    UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
            
        </MasterTableView>
        
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>
        
    </telerik:RadGrid>

    <asp:EntityDataSource ID="EntityDataSourceEEEs" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableDelete="True" EnableFlattening="False" EnableUpdate="True" 
        EntitySetName="Evaluation_Evaluator_Employee" 
        Where="it.Evaluation_FK == @EvalID" EntityTypeFilter="" Select="" Include="User.SBU, User1">
        <WhereParameters>
            <asp:ControlParameter ControlID="EvalSelection" Name="EvalID" DbType="Int32"
                PropertyName="PublicSelectedValue" DefaultValue="0" />
        </WhereParameters>
    </asp:EntityDataSource>

</asp:Panel>
<br />
<asp:Panel ID="PanelConfirm" runat="server" meta:resourcekey="PanelConfirmResource1">


<asp:Label ID="LabelError" runat="server" ForeColor="Red" 
        meta:resourcekey="LabelErrorResource1" ></asp:Label>

</asp:Panel>
    </telerik:RadAjaxPanel>

    <asp:EntityDataSource ID="EntityDataSourceEvaluations" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Evaluation_Period" 
        Select="it.[ID], it.[Name], it.[StartDate]">
    </asp:EntityDataSource>
     <asp:EntityDataSource ID="EntityDataSourceUsers" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="Users" Include="Role, SBU">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSourceDepartments" runat="server" 
    ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
    EnableFlattening="False" EntitySetName="SBUs" Select="it.[SBU_ID], it.[Name]">
</asp:EntityDataSource>
</asp:Content>

